import Request from '@/components/pocky-request/index.js'

const apiUrl = {
	getAddressList: '/user/myaddress/getAddressPageList',
	addAddress: '/user/myaddress/addAddressItem',
	updateAddress: '/user/myaddress/setAddressItem',
	deleteAddress: '/user/myaddress/delAddressItem',
	getAddress: '/user/myaddress/getAddressItem',
}

/**
 * 获取分类
 * @param {Object} parameter
 */
export function getAddressList(parameter) {
	return Request().request({
	  url: apiUrl.getAddressList,
	  method: 'POST',
	  data: parameter
	})
}

/**
 * 获取分类
 * @param {Object} parameter
 */
export function addAddress(parameter) {
	return Request().request({
	  url: apiUrl.addAddress,
	  method: 'POST',
	  data: parameter
	})
}

/**
 * 获取分类
 * @param {Object} parameter
 */
export function updateAddress(parameter) {
	return Request().request({
	  url: apiUrl.updateAddress,
	  method: 'POST',
	  data: parameter
	})
}

/**
 * 获取分类
 * @param {Object} parameter
 */
export function deleteAddress(parameter) {
	return Request().request({
	  url: apiUrl.deleteAddress,
	  method: 'POST',
	  data: parameter
	})
}

/**
 * 获取分类
 * @param {Object} parameter
 */
export function getAddress(parameter) {
	return Request().request({
	  url: apiUrl.getAddress,
	  method: 'POST',
	  data: parameter
	})
}